﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net.Sockets;
using Newtonsoft.Json;
using System.Net.NetworkInformation;

/// <summary>
///Client 的摘要说明
/// </summary>
public class BotClient
{
    [JsonIgnore]
    public TcpClient TcpClient { get; set; }

    public Guid ID { get; set; }

    public string Name { get; set; }

    public string IP
    {
        get
        {
            if (TcpClient != null)
            {
                return TcpClient.Client.RemoteEndPoint.ToString();
            }
            return "";
        }
        set { }
    }

    public string Status { get; set; }

    public string Info { get; set; }

    public BotClient() { }

    public BotClient(TcpClient client)
    {
        ID = Guid.NewGuid();
        this.TcpClient = client;
        Name = "";
        Status = ClientStatusEnum.等待;
    }

    /// <summary>
    /// 是否已连接
    /// </summary>
    public bool Connected { get; set; }
}